<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>导航栏</title>
    <style>
        ul{
            list-style-type: none;
            margin: 0;
            padding: 0;
            width: 200px;
            overflow: hidden;
            margin-left: 5px;
        }
        li{
            border-bottom: 10px solid white;
        }
        li a{
            display: block;
            text-decoration: none;
            padding: 10px 20px;
            color: rgb(0,179,84);
            background-color: rgb(225,255,239);
        }
        li a.active {
            background-color: #4CAF50;
            color: white;
        }
        li a:hover:not(.active) {
            background-color: #555;
            color: white;
        }
        li img{
            width: 12%;
            height: 12%;
            float: left;
            margin-right: 10px;
        }
        .first{
            position: relative;
        }
        .dropdown a{
            display: block;
            text-decoration: none;
            background-color: white;
            border-width:10px;
            border-style: solid;
            border-color: rgb(245,245,245);
            font-size: 14px;
            width: 120px;
        }
        .dropdown{
            position: relative;
            display: none;
        }
        .first:hover .dropdown{
            display: block;
        }
    </style>
</head>
<body>
    <ul>
        <li><a class="active" href="#"><img src="home.png" >首页</a></li>

        <li class="first">
            <a href="#">一级栏目</a>
            <div class="dropdown">
                <a href="#">二级栏目</a>
                <a href="#">二级栏目</a>
            </div>
        </li>

        <li class="first">
            <a href="#">一级栏目</a>
            <div class="dropdown">
                <a href="#">二级栏目</a>
                <a href="#">二级栏目</a>
            </div>
        </li>
        <li class="first">
            <a href="#">一级栏目</a>
            <div class="dropdown">
                <a href="#">二级栏目</a>
                <a href="#">二级栏目</a>
            </div>
        </li>
        <li class="first">
            <a href="#">一级栏目</a>
            <div class="dropdown">
                <a href="#">二级栏目</a>
                <a href="#">二级栏目</a>
            </div>
        </li>
    </ul>
</body>
</html>